gtkprintunixdialog: Fix a potential g_object_unref(NULL) call
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 26 Nov 2013 15:08:08 +0000 (15:08 +0000)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 10 Mar 2015 07:32:19 +0000 (07:32 +0000)
The code above checks whether (printer == NULL), so we’d better do so
here as well.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760

gtk/gtkprintunixdialog.c

index 85fca0d3321ca3c47205d99378003c1f53041588..cca1dc54099ddaf30d5409efff35ab7ee320742b 100644 (file)
@@ -961,7 +961,7 @@ void set_cell_sensitivity_func (GtkTreeViewColumn *tree_column,
   else
     g_object_set (cell, "sensitive", TRUE, NULL);
 
-  g_object_unref (printer);
+  g_clear_object (&printer);
 }
 
 static void